Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding toroidal harmonic notebooks #3681

Open
wants to merge 2 commits into
base: feature/toroidal-harmonics
Choose a base branch
from

Conversation

clmould
Copy link
Contributor

@clmould clmould commented Oct 28, 2024

Linked Issues

(This merge request is updated version of #3645)

Closes #{ID}

Description

Interface Changes

Checklist

I confirm that I have completed the following checks:

  • Tests run locally and pass pytest tests --reactor
  • Code quality checks run locally and pass pre-commit run --from-ref develop --to-ref HEAD
  • Documentation built locally and checked sphinx-build -W documentation/source documentation/build

@clmould clmould mentioned this pull request Oct 28, 2024
3 tasks
Copy link

sonarcloud bot commented Oct 28, 2024

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.

Project coverage is 76.02%. Comparing base (25793b8) to head (27871cf).

Files with missing lines Patch % Lines
...n/harmonics/toroidal_harmonics_approx_functions.py 0.00% 28 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           feature/toroidal-harmonics    #3681      +/-   ##
==============================================================
- Coverage                       76.48%   76.02%   -0.47%     
==============================================================
  Files                             230      231       +1     
  Lines                           26767    26795      +28     
==============================================================
- Hits                            20474    20372     -102     
- Misses                           6293     6423     +130     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@clmould clmould marked this pull request as ready for review October 30, 2024 14:47
@clmould clmould requested a review from a team as a code owner October 30, 2024 14:47
Copy link
Contributor

@je-cook je-cook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my naive understand looks really good. Could have have some tests for the function going into the main package please?

@je-cook je-cook added enhancement New feature or request equilibria Tasks relating to the equilibria module labels Nov 4, 2024
Copy link
Contributor

@geograham geograham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments from old merge request:

  • add tests for new functions (and check assumed validity domain).
  • a reference for Olver.

Otherwise, I have just added a couple of comments on the markdown text in your notebooks.

Am_sin[m] = A_m * np.sin(m * sigma_c)

# %% [markdown]
# Now we can use the following
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have written up the markdown equations in the order you use them, however, it might be a bit clearer if you introduce us to the TH equations at the start of the notebook so the reader understands what you are aiming for, before breaking it down into the calculation steps.

#
# $$ \psi_{cos} = R \sqrt{\cosh (\tau) - \cos (\sigma)} Q_{m - \frac{1}{2}}^1
# (\cosh \tau) \cos (m \sigma) $$
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add a brief note hear about order and degree

@je-cook
Copy link
Contributor

je-cook commented Nov 18, 2024

I was just running our tests on develop and we get a warning from one of the conversion functions (from arccos of a number outside the range -1<x>1 could we add a np.clip to this line unless that would have unintended side effects?

(d_1**2 + d_2**2 - 4 * R_0**2) / (2 * d_1 * d_2)

to

np.clip((d_1**2 + d_2**2 - 4 * R_0**2) / (2 * d_1 * d_2), -1, 1)

this seem to remove the warning in my quick test. I think its just floating point problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request equilibria Tasks relating to the equilibria module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants